![]() |
|||||||||||||||||||||||||||||||||||||||
Programming - Loops Continue
OPENING QUESTIONS: Please take a look at this rather 'elegant' code developed by our own sailing master Finn HERE. A bunch of us do have some programming background so using the logical AND, OR and NOT operators makes sense to us. Having said that, we've also got rookies who haven't done coding before and such stuff makes much less sense. So, please let's pair a rookie in your group with a Sensei to work through that code to identify the logical operators and how they are used to great effect in that code. LEARNING TARGET: I will be able to use the AND and OR logic operators in a basic piece of code during today's class. COURSE DOCUMENT: Ver 1.70 is HERE WORK O' THE DAY: We learned about the logical operators AND, OR and NOT during our discussions of boolean math last semester. Recall that:
Please complete the following table (solo) and then review with your team:
═══════════════════════════ Consider the following (kinda silly) code:
1) Why would you get docked a point on that code (it works by the way) 2) What is the logic there? Now consider the following:
3) Senseis: Please explain why THIS works: inputBox is a textBox with a default value of 0:
Now please engage in some "sandbox" time playing with AND, OR and NOT operators.
Rookies, please revise your leap year code from yesterday to include logic operators
|
|||||||||||||||||||||||||||||||||||||||